;
(function () {
    function _typeof(o) {
        "@babel/helpers - typeof";
        return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
            return typeof o;
        } : function (o) {
            return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
        }, _typeof(o);
    }

    function ownKeys(e, r) {
        var t = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
            var o = Object.getOwnPropertySymbols(e);
            r && (o = o.filter(function (r) {
                return Object.getOwnPropertyDescriptor(e, r).enumerable;
            })), t.push.apply(t, o);
        }
        return t;
    }

    function _objectSpread(e) {
        for (var r = 1; r < arguments.length; r++) {
            var t = null != arguments[r] ? arguments[r] : {};
            r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
                _defineProperty(e, r, t[r]);
            }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
                Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
            });
        }
        return e;
    }

    function _defineProperty(e, r, t) {
        return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
            value: t,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : e[r] = t, e;
    }

    function _classCallCheck(a, n) {
        if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
    }

    function _defineProperties(e, r) {
        for (var t = 0; t < r.length; t++) {
            var o = r[t];
            o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
        }
    }

    function _createClass(e, r, t) {
        return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {writable: !1}), e;
    }

    function _toPropertyKey(t) {
        var i = _toPrimitive(t, "string");
        return "symbol" == _typeof(i) ? i : i + "";
    }

    function _toPrimitive(t, r) {
        if ("object" != _typeof(t) || !t) return t;
        var e = t[Symbol.toPrimitive];
        if (void 0 !== e) {
            var i = e.call(t, r || "default");
            if ("object" != _typeof(i)) return i;
            throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === r ? String : Number)(t);
    }

    function _createForOfIteratorHelper(r, e) {
        var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
        if (!t) {
            if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
                t && (r = t);
                var _n = 0, F = function F() {
                };
                return {
                    s: F, n: function n() {
                        return _n >= r.length ? {done: !0} : {done: !1, value: r[_n++]};
                    }, e: function e(r) {
                        throw r;
                    }, f: F
                };
            }
            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }
        var o, a = !0, u = !1;
        return {
            s: function s() {
                t = t.call(r);
            }, n: function n() {
                var r = t.next();
                return a = r.done, r;
            }, e: function e(r) {
                u = !0, o = r;
            }, f: function f() {
                try {
                    a || null == t.return || t.return();
                } finally {
                    if (u) throw o;
                }
            }
        };
    }

    function _unsupportedIterableToArray(r, a) {
        if (r) {
            if ("string" == typeof r) return _arrayLikeToArray(r, a);
            var t = {}.toString.call(r).slice(8, -1);
            return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
        }
    }

    function _arrayLikeToArray(r, a) {
        (null == a || a > r.length) && (a = r.length);
        for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
        return n;
    }

    System.register(['./index-legacy-BBSVeb5I.js', './SelectGroup.vue_vue_type_script_setup_true_lang-legacy-DczqbOUF.js', './executor-legacy-BMXoEXle.js', './SimpleInput.vue_vue_type_script_setup_true_lang-legacy-CRUKVKwE.js', './model-legacy-BU3w3-Vj.js', './vue-codemirror.esm-legacy-kFkrhprE.js'], function (exports, module) {
        'use strict';

        var defineComponent, mergeModels, useModel, withDirectives, vModelText, createElementBlock, openBlock, ref,
            watch, onMounted, withModifiers, createBaseVNode, createVNode, createTextVNode, unref, withCtx, Fragment,
            renderList, toDisplayString, resolveComponent, isRef, normalizeClass, createBlock, createCommentVNode,
            _sfc_main$5, api, _sfc_main$4, _sfc_main$3, getAllExecutorProgramList, _sfc_main$2, getAllTags,
            getDataBasesByPage, createModel, updateModel, LanguageSupport, LRLanguage, LRParser, indentNodeProp,
            foldNodeProp, styleTags, continuedIndent, ExternalTokenizer, ifNotIn, completeFromList, syntaxTree, tags, T,
            json, isJson, isJsonArray;
        return {
            setters: [function (module) {
                defineComponent = module.d;
                mergeModels = module.J;
                useModel = module.m;
                withDirectives = module.L;
                vModelText = module.P;
                createElementBlock = module.a;
                openBlock = module.o;
                ref = module.e;
                watch = module.w;
                onMounted = module.K;
                withModifiers = module.D;
                createBaseVNode = module.b;
                createVNode = module.q;
                createTextVNode = module.v;
                unref = module.u;
                withCtx = module.p;
                Fragment = module.F;
                renderList = module.j;
                toDisplayString = module.t;
                resolveComponent = module.r;
                isRef = module.y;
                normalizeClass = module.n;
                createBlock = module.c;
                createCommentVNode = module.k;
                _sfc_main$5 = module.s;
                api = module.G;
            }, function (module) {
                _sfc_main$4 = module._;
            }, function (module) {
                _sfc_main$3 = module._;
                getAllExecutorProgramList = module.g;
            }, function (module) {
                _sfc_main$2 = module._;
            }, function (module) {
                getAllTags = module.b;
                getDataBasesByPage = module.e;
                createModel = module.f;
                updateModel = module.u;
            }, function (module) {
                LanguageSupport = module.L;
                LRLanguage = module.b;
                LRParser = module.c;
                indentNodeProp = module.d;
                foldNodeProp = module.f;
                styleTags = module.s;
                continuedIndent = module.e;
                ExternalTokenizer = module.E;
                ifNotIn = module.g;
                completeFromList = module.h;
                syntaxTree = module.k;
                tags = module.t;
                T = module.T;
                json = module.j;
                isJson = module.a;
                isJsonArray = module.l;
            }],
            execute: function execute() {
                var _hoisted_1$1 = ["placeholder"];
                var _sfc_main$1 = /* @__PURE__ */defineComponent({
                    __name: "SimpleTextarea",
                    props: /* @__PURE__ */mergeModels({
                        maxlength: {},
                        placeholder: {}
                    }, {
                        "modelValue": {},
                        "modelModifiers": {}
                    }),
                    emits: ["update:modelValue"],
                    setup: function setup(__props) {
                        var value = useModel(__props, "modelValue");
                        return function (_ctx, _cache) {
                            return withDirectives((openBlock(), createElementBlock("textarea", {
                                "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
                                    return value.value = $event;
                                }),
                                placeholder: _ctx.placeholder,
                                class: "h-[80px] w-full resize-none appearance-none border border-transparent rounded-md bg-gray-100 px-2 py-1 font-[monaco] caret-primary outline-none focus:border hover:border focus:border-gray-300 hover:border-gray-300 focus:bg-gray-50 hover:bg-gray-50 placeholder:text-gray-400"
                            }, null, 8, _hoisted_1$1)), [[vModelText, value.value]]);
                        };
                    }
                });

                // This file was generated by lezer-generator. You probably shouldn't edit it.
                var whitespace = 36,
                    LineComment = 1,
                    BlockComment = 2,
                    String$1 = 3,
                    Number = 4,
                    Bool = 5,
                    Null = 6,
                    ParenL = 7,
                    ParenR = 8,
                    BraceL = 9,
                    BraceR = 10,
                    BracketL = 11,
                    BracketR = 12,
                    Semi = 13,
                    Dot = 14,
                    Operator = 15,
                    Punctuation = 16,
                    SpecialVar = 17,
                    Identifier = 18,
                    QuotedIdentifier = 19,
                    Keyword = 20,
                    Type = 21,
                    Bits = 22,
                    Bytes = 23,
                    Builtin = 24;

                function isAlpha(ch) {
                    return ch >= 65 /* Ch.A */ && ch <= 90 /* Ch.Z */ || ch >= 97 /* Ch.a */ && ch <= 122 /* Ch.z */ || ch >= 48 /* Ch._0 */ && ch <= 57 /* Ch._9 */;
                }

                function isHexDigit(ch) {
                    return ch >= 48 /* Ch._0 */ && ch <= 57 /* Ch._9 */ || ch >= 97 /* Ch.a */ && ch <= 102 /* Ch.f */ || ch >= 65 /* Ch.A */ && ch <= 70 /* Ch.F */;
                }

                function readLiteral(input, endQuote, backslashEscapes) {
                    for (var escaped = false; ;) {
                        if (input.next < 0) return;
                        if (input.next == endQuote && !escaped) {
                            input.advance();
                            return;
                        }
                        escaped = backslashEscapes && !escaped && input.next == 92 /* Ch.Backslash */;
                        input.advance();
                    }
                }

                function readDoubleDollarLiteral(input, tag) {
                    scan: for (; ;) {
                        if (input.next < 0) return;
                        if (input.next == 36 /* Ch.Dollar */) {
                            input.advance();
                            for (var i = 0; i < tag.length; i++) {
                                if (input.next != tag.charCodeAt(i)) continue scan;
                                input.advance();
                            }
                            if (input.next == 36 /* Ch.Dollar */) {
                                input.advance();
                                return;
                            }
                        } else {
                            input.advance();
                        }
                    }
                }

                function readPLSQLQuotedLiteral(input, openDelim) {
                    var matchingDelim = "[{<(".indexOf(String.fromCharCode(openDelim));
                    var closeDelim = matchingDelim < 0 ? openDelim : "]}>)".charCodeAt(matchingDelim);
                    for (; ;) {
                        if (input.next < 0) return;
                        if (input.next == closeDelim && input.peek(1) == 39 /* Ch.SingleQuote */) {
                            input.advance(2);
                            return;
                        }
                        input.advance();
                    }
                }

                function readWord(input, result) {
                    for (; ;) {
                        if (input.next != 95 /* Ch.Underscore */ && !isAlpha(input.next)) break;
                        if (result != null) result += String.fromCharCode(input.next);
                        input.advance();
                    }
                    return result;
                }

                function readWordOrQuoted(input) {
                    if (input.next == 39 /* Ch.SingleQuote */ || input.next == 34 /* Ch.DoubleQuote */ || input.next == 96 /* Ch.Backtick */) {
                        var quote = input.next;
                        input.advance();
                        readLiteral(input, quote, false);
                    } else {
                        readWord(input);
                    }
                }

                function readBits(input, endQuote) {
                    while (input.next == 48 /* Ch._0 */ || input.next == 49 /* Ch._1 */) input.advance();
                    if (endQuote && input.next == endQuote) input.advance();
                }

                function readNumber(input, sawDot) {
                    for (; ;) {
                        if (input.next == 46 /* Ch.Dot */) {
                            if (sawDot) break;
                            sawDot = true;
                        } else if (input.next < 48 /* Ch._0 */ || input.next > 57 /* Ch._9 */) {
                            break;
                        }
                        input.advance();
                    }
                    if (input.next == 69 /* Ch.E */ || input.next == 101 /* Ch.e */) {
                        input.advance();
                        if (input.next == 43 /* Ch.Plus */ || input.next == 45 /* Ch.Dash */) input.advance();
                        while (input.next >= 48 /* Ch._0 */ && input.next <= 57 /* Ch._9 */) input.advance();
                    }
                }

                function eol(input) {
                    while (!(input.next < 0 || input.next == 10 /* Ch.Newline */)) input.advance();
                }

                function inString(ch, str) {
                    for (var i = 0; i < str.length; i++) if (str.charCodeAt(i) == ch) return true;
                    return false;
                }

                var Space = " \t\r\n";

                function keywords(keywords, types, builtin) {
                    var result = Object.create(null);
                    result["true"] = result["false"] = Bool;
                    result["null"] = result["unknown"] = Null;
                    var _iterator = _createForOfIteratorHelper(keywords.split(" ")),
                        _step;
                    try {
                        for (_iterator.s(); !(_step = _iterator.n()).done;) {
                            var kw = _step.value;
                            if (kw) result[kw] = Keyword;
                        }
                    } catch (err) {
                        _iterator.e(err);
                    } finally {
                        _iterator.f();
                    }
                    var _iterator2 = _createForOfIteratorHelper(types.split(" ")),
                        _step2;
                    try {
                        for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
                            var tp = _step2.value;
                            if (tp) result[tp] = Type;
                        }
                    } catch (err) {
                        _iterator2.e(err);
                    } finally {
                        _iterator2.f();
                    }
                    var _iterator3 = _createForOfIteratorHelper((builtin || "").split(" ")),
                        _step3;
                    try {
                        for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
                            var _kw = _step3.value;
                            if (_kw) result[_kw] = Builtin;
                        }
                    } catch (err) {
                        _iterator3.e(err);
                    } finally {
                        _iterator3.f();
                    }
                    return result;
                }

                var SQLTypes = "array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ";
                var SQLKeywords = "absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ";
                var defaults = {
                    backslashEscapes: false,
                    hashComments: false,
                    spaceAfterDashes: false,
                    slashComments: false,
                    doubleQuotedStrings: false,
                    doubleDollarQuotedStrings: false,
                    unquotedBitLiterals: false,
                    treatBitsAsBytes: false,
                    charSetCasts: false,
                    plsqlQuotingMechanism: false,
                    operatorChars: "*+\-%<>!=&|~^/",
                    specialVar: "?",
                    identifierQuotes: '"',
                    caseInsensitiveIdentifiers: false,
                    words: /*@__PURE__*/keywords(SQLKeywords, SQLTypes)
                };

                function dialect(spec, kws, types, builtin) {
                    var dialect = {};
                    for (var prop in defaults) dialect[prop] = (spec.hasOwnProperty(prop) ? spec : defaults)[prop];
                    if (kws) dialect.words = keywords(kws, types || "", builtin);
                    return dialect;
                }

                function tokensFor(d) {
                    return new ExternalTokenizer(function (input) {
                        var _a;
                        var next = input.next;
                        input.advance();
                        if (inString(next, Space)) {
                            while (inString(input.next, Space)) input.advance();
                            input.acceptToken(whitespace);
                        } else if (next == 36 /* Ch.Dollar */ && d.doubleDollarQuotedStrings) {
                            var tag = readWord(input, "");
                            if (input.next == 36 /* Ch.Dollar */) {
                                input.advance();
                                readDoubleDollarLiteral(input, tag);
                                input.acceptToken(String$1);
                            }
                        } else if (next == 39 /* Ch.SingleQuote */ || next == 34 /* Ch.DoubleQuote */ && d.doubleQuotedStrings) {
                            readLiteral(input, next, d.backslashEscapes);
                            input.acceptToken(String$1);
                        } else if (next == 35 /* Ch.Hash */ && d.hashComments || next == 47 /* Ch.Slash */ && input.next == 47 /* Ch.Slash */ && d.slashComments) {
                            eol(input);
                            input.acceptToken(LineComment);
                        } else if (next == 45 /* Ch.Dash */ && input.next == 45 /* Ch.Dash */ && (!d.spaceAfterDashes || input.peek(1) == 32 /* Ch.Space */)) {
                            eol(input);
                            input.acceptToken(LineComment);
                        } else if (next == 47 /* Ch.Slash */ && input.next == 42 /* Ch.Star */) {
                            input.advance();
                            for (var depth = 1; ;) {
                                var cur = input.next;
                                if (input.next < 0) break;
                                input.advance();
                                if (cur == 42 /* Ch.Star */ && input.next == 47 /* Ch.Slash */) {
                                    depth--;
                                    input.advance();
                                    if (!depth) break;
                                } else if (cur == 47 /* Ch.Slash */ && input.next == 42 /* Ch.Star */) {
                                    depth++;
                                    input.advance();
                                }
                            }
                            input.acceptToken(BlockComment);
                        } else if ((next == 101 /* Ch.e */ || next == 69 /* Ch.E */) && input.next == 39 /* Ch.SingleQuote */) {
                            input.advance();
                            readLiteral(input, 39 /* Ch.SingleQuote */, true);
                            input.acceptToken(String$1);
                        } else if ((next == 110 /* Ch.n */ || next == 78 /* Ch.N */) && input.next == 39 /* Ch.SingleQuote */ && d.charSetCasts) {
                            input.advance();
                            readLiteral(input, 39 /* Ch.SingleQuote */, d.backslashEscapes);
                            input.acceptToken(String$1);
                        } else if (next == 95 /* Ch.Underscore */ && d.charSetCasts) {
                            for (var i = 0; ; i++) {
                                if (input.next == 39 /* Ch.SingleQuote */ && i > 1) {
                                    input.advance();
                                    readLiteral(input, 39 /* Ch.SingleQuote */, d.backslashEscapes);
                                    input.acceptToken(String$1);
                                    break;
                                }
                                if (!isAlpha(input.next)) break;
                                input.advance();
                            }
                        } else if (d.plsqlQuotingMechanism && (next == 113 /* Ch.q */ || next == 81 /* Ch.Q */) && input.next == 39 /* Ch.SingleQuote */ && input.peek(1) > 0 && !inString(input.peek(1), Space)) {
                            var openDelim = input.peek(1);
                            input.advance(2);
                            readPLSQLQuotedLiteral(input, openDelim);
                            input.acceptToken(String$1);
                        } else if (next == 40 /* Ch.ParenL */) {
                            input.acceptToken(ParenL);
                        } else if (next == 41 /* Ch.ParenR */) {
                            input.acceptToken(ParenR);
                        } else if (next == 123 /* Ch.BraceL */) {
                            input.acceptToken(BraceL);
                        } else if (next == 125 /* Ch.BraceR */) {
                            input.acceptToken(BraceR);
                        } else if (next == 91 /* Ch.BracketL */) {
                            input.acceptToken(BracketL);
                        } else if (next == 93 /* Ch.BracketR */) {
                            input.acceptToken(BracketR);
                        } else if (next == 59 /* Ch.Semi */) {
                            input.acceptToken(Semi);
                        } else if (d.unquotedBitLiterals && next == 48 /* Ch._0 */ && input.next == 98 /* Ch.b */) {
                            input.advance();
                            readBits(input);
                            input.acceptToken(Bits);
                        } else if ((next == 98 /* Ch.b */ || next == 66 /* Ch.B */) && (input.next == 39 /* Ch.SingleQuote */ || input.next == 34 /* Ch.DoubleQuote */)) {
                            var quoteStyle = input.next;
                            input.advance();
                            if (d.treatBitsAsBytes) {
                                readLiteral(input, quoteStyle, d.backslashEscapes);
                                input.acceptToken(Bytes);
                            } else {
                                readBits(input, quoteStyle);
                                input.acceptToken(Bits);
                            }
                        } else if (next == 48 /* Ch._0 */ && (input.next == 120 /* Ch.x */ || input.next == 88 /* Ch.X */) || (next == 120 /* Ch.x */ || next == 88 /* Ch.X */) && input.next == 39 /* Ch.SingleQuote */) {
                            var quoted = input.next == 39 /* Ch.SingleQuote */;
                            input.advance();
                            while (isHexDigit(input.next)) input.advance();
                            if (quoted && input.next == 39 /* Ch.SingleQuote */) input.advance();
                            input.acceptToken(Number);
                        } else if (next == 46 /* Ch.Dot */ && input.next >= 48 /* Ch._0 */ && input.next <= 57 /* Ch._9 */) {
                            readNumber(input, true);
                            input.acceptToken(Number);
                        } else if (next == 46 /* Ch.Dot */) {
                            input.acceptToken(Dot);
                        } else if (next >= 48 /* Ch._0 */ && next <= 57 /* Ch._9 */) {
                            readNumber(input, false);
                            input.acceptToken(Number);
                        } else if (inString(next, d.operatorChars)) {
                            while (inString(input.next, d.operatorChars)) input.advance();
                            input.acceptToken(Operator);
                        } else if (inString(next, d.specialVar)) {
                            if (input.next == next) input.advance();
                            readWordOrQuoted(input);
                            input.acceptToken(SpecialVar);
                        } else if (inString(next, d.identifierQuotes)) {
                            readLiteral(input, next, false);
                            input.acceptToken(QuotedIdentifier);
                        } else if (next == 58 /* Ch.Colon */ || next == 44 /* Ch.Comma */) {
                            input.acceptToken(Punctuation);
                        } else if (isAlpha(next)) {
                            var word = readWord(input, String.fromCharCode(next));
                            input.acceptToken(input.next == 46 /* Ch.Dot */ || input.peek(-word.length - 1) == 46 /* Ch.Dot */ ? Identifier : (_a = d.words[word.toLowerCase()]) !== null && _a !== void 0 ? _a : Identifier);
                        }
                    });
                }

                var tokens = /*@__PURE__*/tokensFor(defaults);

                // This file was generated by lezer-generator. You probably shouldn't edit it.
                var parser$1 = /*@__PURE__*/LRParser.deserialize({
                    version: 14,
                    states: "%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",
                    stateData: ",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",
                    goto: "#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",
                    nodeNames: "⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",
                    maxTerm: 38,
                    nodeProps: [["isolate", -4, 1, 2, 3, 19, ""]],
                    skippedNodes: [0, 1, 2],
                    repeatNodeCount: 3,
                    tokenData: "RORO",
                    tokenizers: [0, tokens],
                    topRules: {
                        "Script": [0, 25]
                    },
                    tokenPrec: 0
                });

                function tokenBefore(tree) {
                    var cursor = tree.cursor().moveTo(tree.from, -1);
                    while (/Comment/.test(cursor.name)) cursor.moveTo(cursor.from, -1);
                    return cursor.node;
                }

                function idName(doc, node) {
                    var text = doc.sliceString(node.from, node.to);
                    var quoted = /^([`'"])(.*)\1$/.exec(text);
                    return quoted ? quoted[2] : text;
                }

                function plainID(node) {
                    return node && (node.name == "Identifier" || node.name == "QuotedIdentifier");
                }

                function pathFor(doc, id) {
                    if (id.name == "CompositeIdentifier") {
                        var path = [];
                        for (var ch = id.firstChild; ch; ch = ch.nextSibling) if (plainID(ch)) path.push(idName(doc, ch));
                        return path;
                    }
                    return [idName(doc, id)];
                }

                function parentsFor(doc, node) {
                    for (var path = []; ;) {
                        if (!node || node.name != ".") return path;
                        var name = tokenBefore(node);
                        if (!plainID(name)) return path;
                        path.unshift(idName(doc, name));
                        node = tokenBefore(name);
                    }
                }

                function sourceContext(state, startPos) {
                    var pos = syntaxTree(state).resolveInner(startPos, -1);
                    var aliases = getAliases(state.doc, pos);
                    if (pos.name == "Identifier" || pos.name == "QuotedIdentifier" || pos.name == "Keyword") {
                        return {
                            from: pos.from,
                            quoted: pos.name == "QuotedIdentifier" ? state.doc.sliceString(pos.from, pos.from + 1) : null,
                            parents: parentsFor(state.doc, tokenBefore(pos)),
                            aliases: aliases
                        };
                    }
                    if (pos.name == ".") {
                        return {
                            from: startPos,
                            quoted: null,
                            parents: parentsFor(state.doc, pos),
                            aliases: aliases
                        };
                    } else {
                        return {
                            from: startPos,
                            quoted: null,
                            parents: [],
                            empty: true,
                            aliases: aliases
                        };
                    }
                }

                var EndFrom = /*@__PURE__*/new Set(/*@__PURE__*/"where group having order union intersect except all distinct limit offset fetch for".split(" "));

                function getAliases(doc, at) {
                    var statement;
                    for (var parent = at; !statement; parent = parent.parent) {
                        if (!parent) return null;
                        if (parent.name == "Statement") statement = parent;
                    }
                    var aliases = null;
                    for (var scan = statement.firstChild, sawFrom = false, prevID = null; scan; scan = scan.nextSibling) {
                        var kw = scan.name == "Keyword" ? doc.sliceString(scan.from, scan.to).toLowerCase() : null;
                        var alias = null;
                        if (!sawFrom) {
                            sawFrom = kw == "from";
                        } else if (kw == "as" && prevID && plainID(scan.nextSibling)) {
                            alias = idName(doc, scan.nextSibling);
                        } else if (kw && EndFrom.has(kw)) {
                            break;
                        } else if (prevID && plainID(scan)) {
                            alias = idName(doc, scan);
                        }
                        if (alias) {
                            if (!aliases) aliases = Object.create(null);
                            aliases[alias] = pathFor(doc, prevID);
                        }
                        prevID = /Identifier$/.test(scan.name) ? scan : null;
                    }
                    return aliases;
                }

                function maybeQuoteCompletions(quote, completions) {
                    if (!quote) return completions;
                    return completions.map(function (c) {
                        return Object.assign(Object.assign({}, c), {
                            label: c.label[0] == quote ? c.label : quote + c.label + quote,
                            apply: undefined
                        });
                    });
                }

                var Span = /^\w*$/,
                    QuotedSpan = /^[`'"]?\w*[`'"]?$/;

                function isSelfTag(namespace) {
                    return namespace.self && typeof namespace.self.label == "string";
                }

                var CompletionLevel = /*#__PURE__*/function () {
                    function CompletionLevel(idQuote, idCaseInsensitive) {
                        _classCallCheck(this, CompletionLevel);
                        this.idQuote = idQuote;
                        this.idCaseInsensitive = idCaseInsensitive;
                        this.list = [];
                        this.children = undefined;
                    }

                    return _createClass(CompletionLevel, [{
                        key: "child",
                        value: function child(name) {
                            var children = this.children || (this.children = Object.create(null));
                            var found = children[name];
                            if (found) return found;
                            if (name && !this.list.some(function (c) {
                                return c.label == name;
                            })) this.list.push(nameCompletion(name, "type", this.idQuote, this.idCaseInsensitive));
                            return children[name] = new CompletionLevel(this.idQuote, this.idCaseInsensitive);
                        }
                    }, {
                        key: "maybeChild",
                        value: function maybeChild(name) {
                            return this.children ? this.children[name] : null;
                        }
                    }, {
                        key: "addCompletion",
                        value: function addCompletion(option) {
                            var found = this.list.findIndex(function (o) {
                                return o.label == option.label;
                            });
                            if (found > -1) this.list[found] = option; else this.list.push(option);
                        }
                    }, {
                        key: "addCompletions",
                        value: function addCompletions(completions) {
                            var _iterator4 = _createForOfIteratorHelper(completions),
                                _step4;
                            try {
                                for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
                                    var option = _step4.value;
                                    this.addCompletion(typeof option == "string" ? nameCompletion(option, "property", this.idQuote, this.idCaseInsensitive) : option);
                                }
                            } catch (err) {
                                _iterator4.e(err);
                            } finally {
                                _iterator4.f();
                            }
                        }
                    }, {
                        key: "addNamespace",
                        value: function addNamespace(namespace) {
                            if (Array.isArray(namespace)) {
                                this.addCompletions(namespace);
                            } else if (isSelfTag(namespace)) {
                                this.addNamespace(namespace.children);
                            } else {
                                this.addNamespaceObject(namespace);
                            }
                        }
                    }, {
                        key: "addNamespaceObject",
                        value: function addNamespaceObject(namespace) {
                            for (var _i = 0, _Object$keys = Object.keys(namespace); _i < _Object$keys.length; _i++) {
                                var name = _Object$keys[_i];
                                var children = namespace[name],
                                    self = null;
                                var parts = name.replace(/\\?\./g, function (p) {
                                    return p == "." ? "\0" : p;
                                }).split("\0");
                                var scope = this;
                                if (isSelfTag(children)) {
                                    self = children.self;
                                    children = children.children;
                                }
                                for (var i = 0; i < parts.length; i++) {
                                    if (self && i == parts.length - 1) scope.addCompletion(self);
                                    scope = scope.child(parts[i].replace(/\\\./g, "."));
                                }
                                scope.addNamespace(children);
                            }
                        }
                    }]);
                }();

                function nameCompletion(label, type, idQuote, idCaseInsensitive) {
                    if (new RegExp("^[a-z_][a-z_\\d]*$", idCaseInsensitive ? "i" : "").test(label)) return {
                        label: label,
                        type: type
                    };
                    return {
                        label: label,
                        type: type,
                        apply: idQuote + label + idQuote
                    };
                }

                // Some of this is more gnarly than it has to be because we're also
                // supporting the deprecated, not-so-well-considered style of
                // supplying the schema (dotted property names for schemas, separate
                // `tables` and `schemas` completions).
                function completeFromSchema(schema, tables, schemas, defaultTableName, defaultSchemaName, dialect) {
                    var _a;
                    var idQuote = ((_a = dialect === null || dialect === void 0 ? void 0 : dialect.spec.identifierQuotes) === null || _a === void 0 ? void 0 : _a[0]) || '"';
                    var top = new CompletionLevel(idQuote, !!(dialect === null || dialect === void 0 ? void 0 : dialect.spec.caseInsensitiveIdentifiers));
                    var defaultSchema = defaultSchemaName ? top.child(defaultSchemaName) : null;
                    top.addNamespace(schema);
                    if (tables) (defaultSchema || top).addCompletions(tables);
                    if (schemas) top.addCompletions(schemas);
                    if (defaultSchema) top.addCompletions(defaultSchema.list);
                    if (defaultTableName) top.addCompletions((defaultSchema || top).child(defaultTableName).list);
                    return function (context) {
                        var _sourceContext = sourceContext(context.state, context.pos),
                            parents = _sourceContext.parents,
                            from = _sourceContext.from,
                            quoted = _sourceContext.quoted,
                            empty = _sourceContext.empty,
                            aliases = _sourceContext.aliases;
                        if (empty && !context.explicit) return null;
                        if (aliases && parents.length == 1) parents = aliases[parents[0]] || parents;
                        var level = top;
                        var _iterator5 = _createForOfIteratorHelper(parents),
                            _step5;
                        try {
                            for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
                                var name = _step5.value;
                                while (!level.children || !level.children[name]) {
                                    if (level == top && defaultSchema) level = defaultSchema; else if (level == defaultSchema && defaultTableName) level = level.child(defaultTableName); else return null;
                                }
                                var next = level.maybeChild(name);
                                if (!next) return null;
                                level = next;
                            }
                        } catch (err) {
                            _iterator5.e(err);
                        } finally {
                            _iterator5.f();
                        }
                        var quoteAfter = quoted && context.state.sliceDoc(context.pos, context.pos + 1) == quoted;
                        var options = level.list;
                        if (level == top && aliases) options = options.concat(Object.keys(aliases).map(function (name) {
                            return {
                                label: name,
                                type: "constant"
                            };
                        }));
                        return {
                            from: from,
                            to: quoteAfter ? context.pos + 1 : undefined,
                            options: maybeQuoteCompletions(quoted, options),
                            validFor: quoted ? QuotedSpan : Span
                        };
                    };
                }

                function completionType(tokenType) {
                    return tokenType == Type ? "type" : tokenType == Keyword ? "keyword" : "variable";
                }

                function completeKeywords(keywords, upperCase, build) {
                    var completions = Object.keys(keywords).map(function (keyword) {
                        return build(upperCase ? keyword.toUpperCase() : keyword, completionType(keywords[keyword]));
                    });
                    return ifNotIn(["QuotedIdentifier", "SpecialVar", "String", "LineComment", "BlockComment", "."], completeFromList(completions));
                }

                var parser = /*@__PURE__*/parser$1.configure({
                    props: [/*@__PURE__*/indentNodeProp.add({
                        Statement: /*@__PURE__*/continuedIndent()
                    }), /*@__PURE__*/foldNodeProp.add({
                        Statement: function Statement(tree, state) {
                            return {
                                from: Math.min(tree.from + 100, state.doc.lineAt(tree.from).to),
                                to: tree.to
                            };
                        },
                        BlockComment: function BlockComment(tree) {
                            return {
                                from: tree.from + 2,
                                to: tree.to - 2
                            };
                        }
                    }), /*@__PURE__*/styleTags({
                        Keyword: tags.keyword,
                        Type: tags.typeName,
                        Builtin: /*@__PURE__*/tags.standard(tags.name),
                        Bits: tags.number,
                        Bytes: tags.string,
                        Bool: tags.bool,
                        Null: tags.null,
                        Number: tags.number,
                        String: tags.string,
                        Identifier: tags.name,
                        QuotedIdentifier: /*@__PURE__*/tags.special(tags.string),
                        SpecialVar: /*@__PURE__*/tags.special(tags.name),
                        LineComment: tags.lineComment,
                        BlockComment: tags.blockComment,
                        Operator: tags.operator,
                        "Semi Punctuation": tags.punctuation,
                        "( )": tags.paren,
                        "{ }": tags.brace,
                        "[ ]": tags.squareBracket
                    })]
                });
                /**
                 Represents an SQL dialect.
                 */
                var SQLDialect = /*#__PURE__*/function () {
                    function SQLDialect(
                        /**
                         @internal
                         */
                        dialect,
                        /**
                         The language for this dialect.
                         */
                        language,
                        /**
                         The spec used to define this dialect.
                         */
                        spec) {
                        _classCallCheck(this, SQLDialect);
                        this.dialect = dialect;
                        this.language = language;
                        this.spec = spec;
                    }

                    /**
                     Returns the language for this dialect as an extension.
                     */
                    return _createClass(SQLDialect, [{
                        key: "extension",
                        get: function get() {
                            return this.language.extension;
                        }
                        /**
                         Define a new dialect.
                         */
                    }], [{
                        key: "define",
                        value: function define(spec) {
                            var d = dialect(spec, spec.keywords, spec.types, spec.builtin);
                            var language = LRLanguage.define({
                                name: "sql",
                                parser: parser.configure({
                                    tokenizers: [{
                                        from: tokens,
                                        to: tokensFor(d)
                                    }]
                                }),
                                languageData: {
                                    commentTokens: {
                                        line: "--",
                                        block: {
                                            open: "/*",
                                            close: "*/"
                                        }
                                    },
                                    closeBrackets: {
                                        brackets: ["(", "[", "{", "'", '"', "`"]
                                    }
                                }
                            });
                            return new SQLDialect(d, language, spec);
                        }
                    }]);
                }();

                function defaultKeyword(label, type) {
                    return {
                        label: label,
                        type: type,
                        boost: -1
                    };
                }

                /**
                 Returns a completion source that provides keyword completion for
                 the given SQL dialect.
                 */
                function keywordCompletionSource(dialect) {
                    var upperCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
                    var build = arguments.length > 2 ? arguments[2] : undefined;
                    return completeKeywords(dialect.dialect.words, upperCase, build || defaultKeyword);
                }

                /**
                 Returns a completion sources that provides schema-based completion
                 for the given configuration.
                 */
                function schemaCompletionSource(config) {
                    return config.schema ? completeFromSchema(config.schema, config.tables, config.schemas, config.defaultTable, config.defaultSchema, config.dialect || StandardSQL) : function () {
                        return null;
                    };
                }

                function schemaCompletion(config) {
                    return config.schema ? (config.dialect || StandardSQL).language.data.of({
                        autocomplete: schemaCompletionSource(config)
                    }) : [];
                }

                /**
                 SQL language support for the given SQL dialect, with keyword
                 completion, and, if provided, schema-based completion as extra
                 extensions.
                 */
                function sql() {
                    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
                    var lang = config.dialect || StandardSQL;
                    return new LanguageSupport(lang.language, [schemaCompletion(config), lang.language.data.of({
                        autocomplete: keywordCompletionSource(lang, config.upperCaseKeywords, config.keywordCompletion)
                    })]);
                }

                /**
                 The standard SQL dialect.
                 */
                var StandardSQL = /*@__PURE__*/SQLDialect.define({});
                var _hoisted_1 = {
                    class: "form-group"
                };
                var _hoisted_2 = {
                    class: "form-group"
                };
                var _hoisted_3 = {
                    class: "form-group"
                };
                var _hoisted_4 = {
                    class: "form-group"
                };
                var _hoisted_5 = ["value"];
                var _hoisted_6 = {
                    class: "form-group"
                };
                var _hoisted_7 = ["value"];
                var _hoisted_8 = {
                    class: "form-group"
                };
                var _hoisted_9 = ["value"];
                var _hoisted_10 = {
                    class: "form-group"
                };
                var _hoisted_11 = ["value"];
                var _hoisted_12 = {
                    class: "form-group"
                };
                var _hoisted_13 = {
                    class: "flex cursor-pointer items-center justify-between rounded-md bg-gray-100 px3 py2 hover:bg-gray-200"
                };
                var _hoisted_14 = {
                    key: 0,
                    class: "color-fade"
                };
                var _hoisted_15 = {
                    key: 1,
                    class: "truncate color-base op90"
                };
                var _hoisted_16 = {
                    class: "form-group"
                };
                var _hoisted_17 = {
                    class: "form-group"
                };
                var _sfc_main = exports("_", /* @__PURE__ */defineComponent({
                    __name: "model-form",
                    props: {
                        type: {},
                        model: {}
                    },
                    emits: ["success"],
                    setup: function setup(__props, _ref) {
                        var __emit = _ref.emit;
                        var props = __props;
                        var emit = __emit;
                        var formInfo = ref({
                            modelName: "",
                            modelCode: "",
                            scope: "",
                            modelType: "rdbms",
                            executorProgramId: "",
                            tags: "",
                            description: "",
                            record: "",
                            sql: "",
                            defaultParam: "",
                            paramMeta: "",
                            resultMeta: "",
                            sourceDbId: "",
                            destinationDbId: ""
                        });
                        var tagList = ref([]);

                        function initForm() {
                            if (props.model && props.type === "UPDATE") {
                                formInfo.value = Object.assign({}, props.model, {
                                    tags: props.model.tags || "[]",
                                    defaultParam: JSON.stringify(props.model.defaultParam, null, 2) || "",
                                    paramMeta: JSON.stringify(props.model.paramMeta, null, 2) || "",
                                    resultMeta: JSON.stringify(props.model.resultMeta, null, 2) || ""
                                });
                                tagList.value = JSON.parse(formInfo.value.tags);
                            }
                        }

                        watch(function () {
                            return props.model;
                        }, function () {
                            initForm();
                        }, {
                            immediate: true
                        });
                        var codeStyle = {
                            flex: 1,
                            background: "white",
                            border: "1px solid #eee",
                            overflowY: "auto",
                            fontSize: "0.9rem"
                        };
                        var allTags = ref([]);

                        function getTags() {
                            getAllTags().then(function (res) {
                                allTags.value = res.data.map(function (item) {
                                    return item.tagName;
                                });
                            }).catch(function () {
                                allTags.value = [];
                            });
                        }

                        var epList = ref([]);

                        function getEpList() {
                            getAllExecutorProgramList().then(function (res) {
                                epList.value = res.data;
                            }).catch(function () {
                                epList.value = [];
                            });
                        }

                        var dbList = ref([]);

                        function getDbList() {
                            getDataBasesByPage({
                                page: 1,
                                pageSize: 100
                            }).then(function (res) {
                                dbList.value = res.data;
                            }).catch(function () {
                                dbList.value = [];
                            });
                        }

                        onMounted(function () {
                            getTags();
                            getEpList();
                            getDbList();
                        });

                        function validateForm() {
                            var _formInfo$value = formInfo.value,
                                modelName = _formInfo$value.modelName,
                                modelCode = _formInfo$value.modelCode,
                                modelType = _formInfo$value.modelType,
                                executorProgramId = _formInfo$value.executorProgramId,
                                scope = _formInfo$value.scope,
                                sourceDbId = _formInfo$value.sourceDbId,
                                destinationDbId = _formInfo$value.destinationDbId,
                                defaultParam = _formInfo$value.defaultParam,
                                paramMeta = _formInfo$value.paramMeta,
                                resultMeta = _formInfo$value.resultMeta;
                            if (!modelName || !modelCode || !scope || !modelType || !executorProgramId || !sourceDbId || !destinationDbId) {
                                api.warn("请填写完整");
                                return false;
                            }
                            if (defaultParam.trim() && !isJson(defaultParam.trim())) {
                                api.warn("默认参数请输入正确的 JSON 格式");
                                return false;
                            }
                            if (paramMeta.trim() && !isJsonArray(paramMeta.trim())) {
                                api.warn("参数元数据请输入正确的 JSON ARRAY 格式");
                                return false;
                            }
                            if (resultMeta.trim() && !isJsonArray(resultMeta.trim())) {
                                api.warn("结果集元数据请输入正确的 JSON ARRAY 格式");
                                return false;
                            }
                            return true;
                        }

                        function generateParams() {
                            var params = _objectSpread(_objectSpread({}, formInfo.value), {}, {
                                tags: tagList.value
                            });
                            if (formInfo.value.defaultParam.trim()) params.defaultParam = JSON.parse(formInfo.value.defaultParam.trim());
                            if (formInfo.value.paramMeta.trim()) params.paramMeta = JSON.parse(formInfo.value.paramMeta.trim());
                            if (formInfo.value.resultMeta.trim()) params.resultMeta = JSON.parse(formInfo.value.resultMeta.trim());
                            return params;
                        }

                        function handleCreate() {
                            if (!validateForm()) return;
                            var params = generateParams();
                            createModel(params).then(function () {
                                api.success("模型创建成功");
                            });
                        }

                        function handleUpdate() {
                            var _props$model;
                            if (!validateForm()) return;
                            var params = generateParams();
                            updateModel((_props$model = props.model) === null || _props$model === void 0 ? void 0 : _props$model.id, params).then(function () {
                                emit("success");
                                api.success("模型更新成功");
                            });
                        }

                        return function (_ctx, _cache) {
                            var _component_SimpleInput = _sfc_main$2;
                            var _component_SimpleSelect = _sfc_main$3;
                            var _component_SelectGroup = _sfc_main$4;
                            var _component_VDropdown = resolveComponent("VDropdown");
                            var _component_SimpleTextarea = _sfc_main$1;
                            var _component_SimpleButton = _sfc_main$5;
                            return openBlock(), createElementBlock("form", {
                                class: "flex flex-col gap-5",
                                onSubmit: _cache[14] || (_cache[14] = withModifiers(function () {
                                }, ["prevent"]))
                            }, [createBaseVNode("div", _hoisted_1, [_cache[15] || (_cache[15] = createBaseVNode("label", null, [createBaseVNode("span", {
                                "text-red-500": ""
                            }, "*"), createTextVNode(" 模型名称 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(modelName)")], -1)), createVNode(_component_SimpleInput, {
                                modelValue: unref(formInfo).modelName,
                                "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
                                    return unref(formInfo).modelName = $event;
                                }),
                                modelModifiers: {
                                    trim: true
                                },
                                placeholder: "请输入",
                                class: "w-full"
                            }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_2, [_cache[16] || (_cache[16] = createBaseVNode("label", null, [createBaseVNode("span", {
                                "text-red-500": ""
                            }, "*"), createTextVNode(" 模型代码 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(modelCode)")], -1)), createVNode(_component_SimpleInput, {
                                modelValue: unref(formInfo).modelCode,
                                "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
                                    return unref(formInfo).modelCode = $event;
                                }),
                                modelModifiers: {
                                    trim: true
                                },
                                placeholder: "请输入",
                                class: "w-full"
                            }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_3, [_cache[17] || (_cache[17] = createBaseVNode("label", null, [createBaseVNode("span", {
                                "text-red-500": ""
                            }, "*"), createTextVNode(" 模型应用范围 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(scope)")], -1)), createVNode(_component_SimpleInput, {
                                modelValue: unref(formInfo).scope,
                                "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
                                    return unref(formInfo).scope = $event;
                                }),
                                modelModifiers: {
                                    trim: true
                                },
                                placeholder: "请输入",
                                class: "w-full"
                            }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_4, [_cache[18] || (_cache[18] = createBaseVNode("label", null, [createBaseVNode("span", {
                                "text-red-500": ""
                            }, "*"), createTextVNode(" 模型类型 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(modelType)")], -1)), createVNode(_component_SimpleSelect, {
                                modelValue: unref(formInfo).modelType,
                                "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
                                    return unref(formInfo).modelType = $event;
                                }),
                                placeholder: "请选择"
                            }, {
                                default: withCtx(function () {
                                    return [(openBlock(), createElementBlock(Fragment, null, renderList(["rdbms", "graph"], function (item) {
                                        return createBaseVNode("option", {
                                            key: item,
                                            value: item
                                        }, toDisplayString(item), 9, _hoisted_5);
                                    }), 64))];
                                }),
                                _: 1
                            }, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_6, [_cache[19] || (_cache[19] = createBaseVNode("label", null, [createBaseVNode("span", {
                                "text-red-500": ""
                            }, "*"), createTextVNode(" 执行程序 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(executorProgramId)")], -1)), createVNode(_component_SimpleSelect, {
                                modelValue: unref(formInfo).executorProgramId,
                                "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
                                    return unref(formInfo).executorProgramId = $event;
                                }),
                                placeholder: "请选择"
                            }, {
                                default: withCtx(function () {
                                    return [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(epList), function (item) {
                                        return openBlock(), createElementBlock("option", {
                                            key: item.id,
                                            value: item.id
                                        }, toDisplayString(item.executorName), 9, _hoisted_7);
                                    }), 128))];
                                }),
                                _: 1
                            }, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_8, [_cache[20] || (_cache[20] = createBaseVNode("label", null, [createBaseVNode("span", {
                                "text-red-500": ""
                            }, "*"), createTextVNode(" 源数据源 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(sourceDbId)")], -1)), createVNode(_component_SimpleSelect, {
                                modelValue: unref(formInfo).sourceDbId,
                                "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
                                    return unref(formInfo).sourceDbId = $event;
                                }),
                                placeholder: "请选择"
                            }, {
                                default: withCtx(function () {
                                    return [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dbList), function (item) {
                                        return openBlock(), createElementBlock("option", {
                                            key: item.id,
                                            value: item.id
                                        }, toDisplayString(item.rdbName), 9, _hoisted_9);
                                    }), 128))];
                                }),
                                _: 1
                            }, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_10, [_cache[21] || (_cache[21] = createBaseVNode("label", null, [createBaseVNode("span", {
                                "text-red-500": ""
                            }, "*"), createTextVNode(" 目标数据源 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(destinationDbId)")], -1)), createVNode(_component_SimpleSelect, {
                                modelValue: unref(formInfo).destinationDbId,
                                "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) {
                                    return unref(formInfo).destinationDbId = $event;
                                }),
                                placeholder: "请选择"
                            }, {
                                default: withCtx(function () {
                                    return [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dbList), function (item) {
                                        return openBlock(), createElementBlock("option", {
                                            key: item.id,
                                            value: item.id
                                        }, toDisplayString(item.rdbName), 9, _hoisted_11);
                                    }), 128))];
                                }),
                                _: 1
                            }, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_12, [_cache[23] || (_cache[23] = createBaseVNode("label", null, [createTextVNode("模型标签 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(tags)")], -1)), createVNode(_component_VDropdown, {
                                "auto-size": "",
                                "popper-class": "no-arrow"
                            }, {
                                popper: withCtx(function () {
                                    return [createVNode(_component_SelectGroup, {
                                        modelValue: unref(tagList),
                                        "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) {
                                            return isRef(tagList) ? tagList.value = $event : null;
                                        }),
                                        options: unref(allTags),
                                        titles: unref(allTags).map(function (item) {
                                            return "#".concat(item);
                                        }),
                                        multiple: "",
                                        class: "max-h-60 w-full flex flex-col flex-nowrap overflow-y-overlay p-2 !gap-1 !text-base",
                                        props: unref(allTags).map(function (i) {
                                            return {
                                                class: "py-1 text-0.9rem ".concat(unref(tagList).includes(i) ? "!bg-primary/10 !hover:bg-primary/10" : "!bg-base !hover:bg-hover")
                                            };
                                        })
                                    }, null, 8, ["modelValue", "options", "titles", "props"])];
                                }),
                                default: withCtx(function () {
                                    var _unref;
                                    return [createBaseVNode("div", _hoisted_13, [!((_unref = unref(tagList)) !== null && _unref !== void 0 && _unref.length) ? (openBlock(), createElementBlock("span", _hoisted_14, "选择标签")) : (openBlock(), createElementBlock("span", _hoisted_15, toDisplayString(unref(tagList).map(function (item) {
                                        return "#".concat(item);
                                    }).join(", ")), 1)), _cache[22] || (_cache[22] = createBaseVNode("div", {
                                        class: "i-ph-caret-down ml-2 flex-none op40"
                                    }, null, -1))])];
                                }),
                                _: 1
                            })]), createBaseVNode("div", _hoisted_16, [_cache[24] || (_cache[24] = createBaseVNode("label", null, [createTextVNode("模型描述 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(desciption)")], -1)), createVNode(_component_SimpleTextarea, {
                                modelValue: unref(formInfo).description,
                                "onUpdate:modelValue": _cache[8] || (_cache[8] = function ($event) {
                                    return unref(formInfo).description = $event;
                                }),
                                modelModifiers: {
                                    trim: true
                                },
                                placeholder: "请输入",
                                class: "h-60px w-full"
                            }, null, 8, ["modelValue"])]), createBaseVNode("div", _hoisted_17, [_cache[25] || (_cache[25] = createBaseVNode("label", null, [createTextVNode("模型备注 "), createBaseVNode("code", {
                                class: "color-fade"
                            }, "(record)")], -1)), createVNode(_component_SimpleTextarea, {
                                modelValue: unref(formInfo).record,
                                "onUpdate:modelValue": _cache[9] || (_cache[9] = function ($event) {
                                    return unref(formInfo).record = $event;
                                }),
                                modelModifiers: {
                                    trim: true
                                },
                                placeholder: "请输入",
                                class: "h-60px w-full"
                            }, null, 8, ["modelValue"])]), createBaseVNode("div", {
                                class: normalizeClass(["form-group", {
                                    "h-60 min-h-60": _ctx.type === "CREATE"
                                }])
                            }, [_cache[26] || (_cache[26] = createBaseVNode("label", {
                                class: "flex items-center"
                            }, [createTextVNode(" SQL 脚本"), createBaseVNode("code", {
                                class: "color-fade"
                            }, " (sql)"), createBaseVNode("span", {
                                class: "ml-auto yellow-badge py-2px text-sm"
                            }, "SQL 格式")], -1)), createVNode(unref(T), {
                                modelValue: unref(formInfo).sql,
                                "onUpdate:modelValue": _cache[10] || (_cache[10] = function ($event) {
                                    return unref(formInfo).sql = $event;
                                }),
                                placeholder: "请输入",
                                style: codeStyle,
                                "indent-with-tab": true,
                                "tab-size": 4,
                                extensions: [unref(sql)()]
                            }, null, 8, ["modelValue", "extensions"])], 2), createBaseVNode("div", {
                                class: normalizeClass(["form-group", {
                                    "h-26 min-h-26": _ctx.type === "CREATE"
                                }])
                            }, [_cache[27] || (_cache[27] = createBaseVNode("label", {
                                class: "flex items-center"
                            }, [createTextVNode(" 默认参数"), createBaseVNode("code", {
                                class: "color-fade"
                            }, " (defaultParam)"), createBaseVNode("span", {
                                class: "ml-auto yellow-badge py-2px text-sm"
                            }, "JSON 格式")], -1)), createVNode(unref(T), {
                                modelValue: unref(formInfo).defaultParam,
                                "onUpdate:modelValue": _cache[11] || (_cache[11] = function ($event) {
                                    return unref(formInfo).defaultParam = $event;
                                }),
                                placeholder: "请输入",
                                style: codeStyle,
                                "indent-with-tab": true,
                                "tab-size": 2,
                                extensions: [unref(json)()]
                            }, null, 8, ["modelValue", "extensions"])], 2), createBaseVNode("div", {
                                class: normalizeClass(["form-group", {
                                    "h-40 min-h-40": _ctx.type === "CREATE"
                                }])
                            }, [_cache[28] || (_cache[28] = createBaseVNode("label", {
                                class: "flex items-center"
                            }, [createTextVNode(" 参数元数据"), createBaseVNode("code", {
                                class: "color-fade"
                            }, " (paramMeta)"), createBaseVNode("span", {
                                class: "ml-auto yellow-badge py-2px text-sm"
                            }, "JSON Array 格式")], -1)), createVNode(unref(T), {
                                modelValue: unref(formInfo).paramMeta,
                                "onUpdate:modelValue": _cache[12] || (_cache[12] = function ($event) {
                                    return unref(formInfo).paramMeta = $event;
                                }),
                                placeholder: "请输入",
                                style: codeStyle,
                                "indent-with-tab": true,
                                "tab-size": 2,
                                extensions: [unref(json)()]
                            }, null, 8, ["modelValue", "extensions"])], 2), createBaseVNode("div", {
                                class: normalizeClass(["form-group", {
                                    "h-40 min-h-40": _ctx.type === "CREATE"
                                }])
                            }, [_cache[29] || (_cache[29] = createBaseVNode("label", {
                                class: "flex items-center"
                            }, [createTextVNode(" 结果集元数据"), createBaseVNode("code", {
                                class: "color-fade"
                            }, " (resultMeta)"), createBaseVNode("span", {
                                class: "ml-auto yellow-badge py-2px text-sm"
                            }, "JSON Array 格式")], -1)), createVNode(unref(T), {
                                modelValue: unref(formInfo).resultMeta,
                                "onUpdate:modelValue": _cache[13] || (_cache[13] = function ($event) {
                                    return unref(formInfo).resultMeta = $event;
                                }),
                                placeholder: "请输入",
                                style: codeStyle,
                                "indent-with-tab": true,
                                "tab-size": 2,
                                extensions: [unref(json)()]
                            }, null, 8, ["modelValue", "extensions"])], 2), createBaseVNode("div", {
                                class: normalizeClass(["mt-4 flex-center", {
                                    "sticky bottom-0": _ctx.type === "UPDATE"
                                }])
                            }, [_ctx.type === "CREATE" ? (openBlock(), createBlock(_component_SimpleButton, {
                                key: 0,
                                class: "!h-10",
                                type: "primary",
                                onClick: handleCreate
                            }, {
                                default: withCtx(function () {
                                    return _cache[30] || (_cache[30] = [createTextVNode(" 创建模型 ")]);
                                }),
                                _: 1
                            })) : createCommentVNode("", true), _ctx.type === "UPDATE" ? (openBlock(), createBlock(_component_SimpleButton, {
                                key: 1,
                                class: "!h-10",
                                type: "primary",
                                onClick: handleUpdate
                            }, {
                                default: withCtx(function () {
                                    return _cache[31] || (_cache[31] = [createTextVNode(" 确认更新 ")]);
                                }),
                                _: 1
                            })) : createCommentVNode("", true)], 2)], 32);
                        };
                    }
                }));
            }
        };
    });
})();
